/* 
 * Gneat (http://gneat.org)
 *
 * (C) Copyright 2011 and beyond - Claudio Stella, all rights reserved.
 *
 * This file is part of Gneat.
 *
 * Gneat is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License (LGPL)
 * as published by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gneat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * and the GNU General Public License, for completeness, along with Gneat.  
 * If not, see <http://www.gnu.org/licenses/>.
 */
package org.neatshell.gneat.client.presenter.core;

import java.util.List;

import org.neatshell.gneat.client.callback.CallbackListBoolean;
import org.neatshell.gneat.client.callback.CallbackListVoid;
import org.neatshell.gneat.client.presenter.core.events.EventsList;
import org.neatshell.gneat.client.presenter.core.events.HandlerAttachmentList;
import org.neatshell.gneat.client.presenter.core.manipulation.AttributesList;
import org.neatshell.gneat.client.presenter.core.manipulation.ClassAttributeList;
import org.neatshell.gneat.client.presenter.core.manipulation.InsertionAroundList;
import org.neatshell.gneat.client.presenter.core.manipulation.InsertionInsideList;
import org.neatshell.gneat.client.presenter.core.manipulation.PropertiesList;
import org.neatshell.gneat.client.presenter.core.manipulation.RemovalList;
import org.neatshell.gneat.client.presenter.core.manipulation.StylePropertiesList;
import org.neatshell.gneat.client.presenter.core.misc.AddingList;
import org.neatshell.gneat.client.presenter.core.misc.CopyingList;
import org.neatshell.gneat.client.presenter.core.misc.DataList;
import org.neatshell.gneat.client.presenter.core.traversing.FilteringList;
import org.neatshell.gneat.client.presenter.core.traversing.TreeTraversalList;

public interface IPresenterList extends 
	AddingList,
	AttributesList,
	ClassAttributeList,
	CopyingList,
	EventsList,
	DataList,
	FilteringList,
	HandlerAttachmentList,
	InsertionAroundList,
	InsertionInsideList,
//	InsertionOutsideList,
	PropertiesList,
	RemovalList,
//	ReplacementList,
	StylePropertiesList,
	TreeTraversalList {

	/**
	 * Gets the item at the given index
	 * @param index an integer indicating the 0-based position of the item.
	 * If <b>negative</b>, index indicates the position of the item, counting backwards 
	 * from the last item of the list
	 * @return the Presenter object at the specified index if exists, 
	 * the <b>PresenterNull</b> object otherwise
	 */
	IPresenter get(Integer index);

	/**
	 * Gets the index of the passed item
	 * @return the 0-based position of the passed item if contained in this list, <b>-1</b> otherwise
	 */
	int index(IPresenter item);

	/**
	 * Gets the number of items contained in this list
	 * @return 0 or a positive integer
	 */
	int length();

	IPresenter[] toArray();
	List<IPresenter> toList();

	IPresenterList each(CallbackListBoolean callback);
	IPresenterList each(CallbackListVoid callback);
}